package ModelLayer;

/**
 * Write a description of class Item here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Item
{
    private String barCode;
    private String itemName;
    private String description;
    private double retailPrice;
    private double buyingPrice;
    private String location;
    private double discount;
    private int minAmount;
    private int restockAmount;
    private int amount;

    /**
     * Constructor for objects of class Item.
     * @param barCode, the barcode that identifies this item.
     * @param itemName, the name of the item.
     * @param description, the items description.
     * @param retailPrice, the items retailprice (the price that customers pay).
     * @param buyingPrice, the items buyingprice (the price that the shop has paid the supplier for the item).
     * @param location, the location of the item in the shop storage.
     * @param discount, the discount on this item.
     * @param minAmount, the minimum amount of this item to have in the storage.
     * @param restockAmount, the amount of items to be ordered when minimum amount is reached.
     * @param amount, the current amount of items in the storage.
     */
    public Item(String barCode, String itemName, String description, double retailPrice, double buyingPrice, String location, double discount, int minAmount, int restockAmount, int amount)
    {
        this.barCode = barCode;
        this.itemName = itemName;
        this.description = description;
        this.retailPrice = retailPrice;
        this.buyingPrice = buyingPrice;
        this.location = location;
        this.discount = discount;
        this.minAmount = minAmount;
        this.restockAmount = restockAmount;
        this.amount = amount;

    }

    /**
     * Returns barCode on this item.
     * @return barCode.
     */    
    public String getBarCode()
    {
        return barCode;
    }

    /**
     * Returns itemName on this item.
     * @return itemName.
     */    
    public String getItemName()
    {
        return itemName;
    }

    /**
     * Returns description on this item.
     * @return description.
     */    
    public String getDescription()
    {
        return description;
    }

    /**
     * Returns retailPrice on this item.
     * @return retailPrice.
     */    
    public double getRetailPrice()
    {
        return retailPrice;
    }

    /**
     * Returns buyingPrice on this item.
     * @return buyingPrice.
     */    
    public double getBuyingPrice()
    {
        return buyingPrice;
    }

    /**
     * Returns location on this item.
     * @return location.
     */    
    public String getLocation()
    {
        return location;
    }

    /**
     * Returns discount on this item.
     * @return discount.
     */    
    public double getDiscount()
    {
        return discount;
    }

    /**
     * Returns minAmount on this item.
     * @return minAmount.
     */    
    public int getMinAmount()
    {
        return minAmount;
    }

    /**
     * Returns restockAmount on this item.
     * @return restockAmount.
     */    
    public int getRestockAmount()
    {
        return restockAmount;
    }

    /**
     * Returns amount on this item.
     * @return amount.
     */    
    public int getAmount()
    {
        return amount;
    }

    /**
     * Sets new barcode on this item if needed.
     * @param barCode, the barcode to be set.
     */
    public void setBarCode(String barCode)
    {
        this.barCode = barCode;
    }

    /**
     * Sets new itemName on this item if needed.
     * @param itemName, the itemName to be set.
     */
    public void setItemName(String itemName)
    {
        this.itemName = itemName;
    }

    /**
     * Sets new description on this item if needed.
     * @param description, the description to be set.
     */
    public void setDescription(String description)
    {
        this.description = description;
    }

    /**
     * Sets new retailPrice on this item if needed.
     * @param retailPrice, the retailPrice to be set.
     */
    public void setRetailPrice(double retailPrice)
    {
        this.retailPrice = retailPrice;
    }

    /**
     * Sets new buyingPrice on this item if needed.
     * @param buyingPrice, the buyingPrice to be set.
     */
    public void setBuyingPrice(double buyingPrice)
    {
        this.buyingPrice = buyingPrice;
    }

    /**
     * Sets new location on this item if needed.
     * @param location, the location to be set.
     */
    public void setLocation(String location)
    {
        this.location = location;
    }

    /**
     * Sets new discount on this item if needed.
     * @param discount, the discount to be set.
     */
    public void setDiscount(double discount)
    {
        this.discount = discount;
    }

    /**
     * Sets new minAmount on this item if needed.
     * @param minAmount, the minAmount to be set.
     */
    public void setMinAmount(int minAmount)
    {
        this.minAmount = minAmount;
    }

    /**
     * Sets new restockAmount on this item if needed.
     * @param restockAmount, the restockAmount to be set.
     */
    public void setRestockAmount(int restockAmount)
    {
        this.restockAmount = restockAmount;
    }

    /**
     * Sets new amount on this item if needed.
     * @param amount, the amount to be set.
     */
    public void setAmount(int amount)
    {
        this.amount = amount;
    }

    /**
     * Downsizes inventory.
     * @param quantity, the amount of items to be downsized from the inventory.
     */
    public void downsizeInventory(int quantity)
    {
        amount = amount - quantity; 
    }
}

